package com.aeasycredit.credit.tuef.handler;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.aeasycredit.credit.tuef.constant.TuefSegment;
import com.aeasycredit.credit.tuef.constant.TuefTrendInsightSegmentEnum;
import com.aeasycredit.credit.tuef.model.TuefTrendInsight;
import com.aeasycredit.credit.tuef.service.TuefTrendInsightService;

@Component
public class TuefTrendInsightDataHandler implements TuefDataHandler<List<TuefTrendInsight>> {
    
    @Autowired
    private TuefTrendInsightService tuefTrendInsightService;

    @Override
    public List<TuefTrendInsight> getData(String tuefBasicId) {
        return tuefTrendInsightService.getListByTuefBasicId(tuefBasicId);
    }

    @Override
    public Class<? extends TuefSegment> supportTuefSegment() {
        return TuefTrendInsightSegmentEnum.SEGMENT_TAG.getClass();
    }
    
    @Override
    public TuefSegment[] supportSegmentFields() {
        return TuefTrendInsightSegmentEnum.values();
    }
}
